﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace _12._2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            List<Animal> animals = new List<Animal>();
            animals.Add(new Cow("cow1"));
            animals.Add(new Chicken("chicken1"));

            foreach (Animal  item in animals)
            {
                item.Feed();
                if (item is Cow)
                {
                    (item as Cow).Milk();

                }
                else
                {
                    (item as Chicken).LayEgg();
                }

                
            }
            ReadLine();
        }
    }
}
